﻿using System.Collections.Generic;
using System.ComponentModel;
using NetBay.Core.BusinessEntities;

namespace Rio.Framework.Pages.Workflow.Models
{
    public class FlowTreeModel : INotifyPropertyChanged
    {
        #region Fields

        private Dictionary<FolderType, DataItemTreeViewCollection> _items;
        private Organization _organization;

        #endregion Fields

        #region Constructors

        public FlowTreeModel()
        {
            Items = new Dictionary<FolderType, DataItemTreeViewCollection>();
        }

        #endregion Constructors

        #region Events

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion Events

        #region Properties

        public Dictionary<FolderType, DataItemTreeViewCollection> Items
        {
            get { return _items; }
            set
            {
                _items = value;
                OnPropertyChanged("Items");
            }
        }

        public Organization Organization
        {
            get { return _organization; }
            set
            {
                _organization = value;
                OnPropertyChanged("Organization");
            }
        }

        #endregion Properties

        #region Methods

        /// <summary>
        /// Called when [property changed].
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        public void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion Methods
    }
}